import request from '@/utils/request'

/**
 * 查询游客访问的服务
 * @param params
 * @returns {AxiosPromise}
 */
export function queryAllGuestService(params) {
  return request({
    url: 'rest/config/api/service/pager',
    method: 'get',
    params
  })
}

/**
 * 查询用户关联的服务
 * @param params
 * @returns {AxiosPromise}
 */
export function queryAllUserService(params) {
  return request({
    url: 'rest/api/service/v3/pager',
    method: 'get',
    params
  })
}

export function queryAllUserServiceFl(params) {
  return request({
    url: 'rest/api/service/v3/all/app',
    method: 'get',
    params
  })
}

export function queryAllNotAuth(params) {
  return request({
    url: 'rest/api/s/v4/service/defalult/all',
    method: 'get',
    params
  })
}

/**
 * 保存历史搜索记录
 * @param data
 * @returns {AxiosPromise}
 */
export function saveSearchHistory(data) {
  return request({
    url: 'rest/api/manager/v1/service/searchHistory/save/entity',
    method: 'post',
    data
  })
}

/**
 * 删除历史搜索记录
 * @param ids
 * @returns {AxiosPromise}
 */
export function delSearchHistory(ids) {
  return request({
    url: 'rest/api/manager/v1/service/searchHistory/delByuserid?userid=' + ids,
    method: 'get'
  })
}

/**
 * 分页查询历史搜索记录
 * @param params
 * @returns {AxiosPromise}
 */
export function getSearchHistory(params) {
  return request({
    url: 'rest/api/manager/v1/service/searchHistory/pager',
    method: 'get',
    params
  })
}
